package com.wl2o2o.lanqiao.xzfourteen;

/** 
* @author : WLei224
* @date ：2023年3月30日 下午3:13:07 
* 
*/

import java.util.Arrays;
import java.util.Scanner;
//1:无需package
//2: 类名必须Main, 不可修改


public class BillionsPeople {
	public static void main(String[] args) {
//		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int[] hi = new int[N];
		int[] cnt1 = new int [N];
    cnt1[0] = 0;
		int[] cnt2 = new int [N];
		
		for(int n = 0; n < N; n++) {
			hi[n] = scanner.nextInt();
		}
		
		for (int i = 1; i < N-1; i++) {
			for (int j = 2; j < N; j++) {
				if (hi[i] > hi[j]) {

					cnt1[j]++;
				}
			}
		}
		System.out.println(Arrays.toString(cnt1));
		
		for (int i = 0; i < N-1; i++) {
			for (int j = 1; j < N; j++) {
				if (hi[j] > hi[i]) {
					cnt2[i]++;
				}
					
			}
		}
		System.out.println(Arrays.toString(cnt2));

	}

}
